<!--- SUI模板 on 2017/3/30 -->
<script ng-init="initCss('hello-page/order.css');setTitle('工单列表');init();nextOrders();"></script>
<div class="page">
    <nav class="bar bar-tab">
        <a ng-if="user.userRole=='customer'||user.userRole=='customer_special'||user.userRole=='sales_manager'" class="tab-item external active" href="#order">
            <span class="icon icon-home"></span>
            <span class="tab-label">工单</span>
        </a>
        <a ng-if="user.userRole=='worker'" class="tab-item external" href="#task">
            <span class="icon icon-home"></span>
            <span class="tab-label">任务</span>
        </a>
        <a ng-if="user.userRole=='driver'" class="tab-item external" href="#departure">
            <span class="icon icon-home"></span>
            <span class="tab-label">派车单</span>
        </a>
        <a class="tab-item external" href="#hello">
            <span class="icon icon-me"></span>
            <span class="tab-label">我</span>
        </a>
    </nav>
    <div class="content pull-to-refresh-content infinite-scroll order-list-content" ng-init="">
        <div class="pull-to-refresh-layer my">
            <div class="preloader"></div>
            <div class="pull-to-refresh-arrow"></div>
        </div>
        <div class="content-block-title">您提交的工单列表</div>
        <div class="list-block">
            <ul>
                <li class="item-content item-link"
                    ng-repeat="order in orders track by order.orderNumber"
                    ng-click="openOrderDetail(order)">
                    <div class="item-media"><i class="icon icon-f7"></i></div>
                    <div class="item-inner">
                        <div class="item-title">{{order.orderNumber}}</div>
                        <div class="item-after">{{order|getStatus}}</div>
                    </div>
                </li>
            </ul>
            <!--加载提示符 -->
            <div class="infinite-scroll-preloader">
                <div class="preloader"></div>
                加载中...
            </div>
        </div>
    </div>
    <div class="popup popup-detail">
        <nav class="bar bar-tab bar-popup">
            <a ng-if="user.userRole=='customer'||user.userRole=='customer_special'" class="tab-item external msg-change" ng-click="changeMsg(selectOrder)" href="javascript:;">
                <span class="tab-label">变更留言</span>
            </a>
            <a ng-if="user.userRole=='sales_manager'" class="tab-item external msg-change" ng-click="changeOrderPriority(selectOrder)" href="javascript:;">
                <span class="tab-label">变更优先级</span>
            </a>
            <a class="close-popup tab-item external" href="javascript:;">
                <span class="tab-label">返回</span>
            </a>
        </nav>
        <div class="content-inner-box">
            <div class="content-block" ng-if="selectOrder">
                <p>工单详情</p>
                <p>工单号：{{selectOrder.orderNumber}}</p>
                <p>工单流程：
                    <span ng-repeat="task in selectOrder.orderTasks">
                    {{task.taskProcess.processName}}<span
                            ng-if="selectOrder.orderProductionColor&&task.taskProcess.processName=='镀钛'">({{selectOrder.orderProductionColor}})</span>
                </span>
                </p>
                <p>工单提交时间：{{selectOrder.orderAddTime|date:'yyyy-MM-dd HH:mm:ss'}}</p>
                <p ng-if="selectOrder.orderFinishTime">
                    工单完成时间：{{selectOrder.orderFinishTime|date:'yyyy-MM-dd HH:mm:ss'}}
                </p>
                <p>工单支付状态：{{selectOrder|getPayStatus}}</p>
                <p>工单状态：{{selectOrder|getStatus}}</p>
                <p>留言：{{selectOrder|getLeftMsg}}</p>
            </div>
        </div>

    </div>
</div>
<div ng-init="suiMobileInit()"></div>